package com.lbiuse.biz.manage.user.bean;

import java.util.Date;

public class CUser {
    public static final short DOMAIN_LEVEL=0;
    public static final short SYSTEM_LEVEL=1;
    public static final short STORE_LEVEL=2;
    public static final short MANAGER_LEVEL=3;
    public static final short DEALER_LEVEL=4;
    
//    public static final boolean isSysLevelOfSysLevel(short nSysLevel) {
//    	if (nSysLevel<=SYSTEM_LEVEL) return true;
//    	else return false;
//    }
    
//    public boolean isSysLevel() {
//    	return isSysLevelOfSysLevel(sysLevel);
//    }
    
	private Integer userId;
    private String userName;
	private String password;
	private Date tAdd;
    
	public void setDeleted(Short deleted) {
		this.deleted = deleted;
	}

    private Date tEdit;
	private Short deleted;
	private String zoneId;
	private Short sysLevel;
	private String dealerId;
	private String dealerName;
	private String classPath;

	public String getClassPath() {
		return classPath;
	}

	public void setClassPath(String classPath) {
		this.classPath = classPath;
	}

	public String getDealerName() {
		return dealerName;
	}

	public void setDealerName(String dealerName) {
		this.dealerName = dealerName;
	}

	public Short getSysLevel() {
		return sysLevel;
	}

	public void setSysLevel(Short sysLevel) {
		this.sysLevel = sysLevel;
	}

	public CUser() {
	}

	public CUser(boolean bInitial) {
		if (bInitial) {
			initial();
		}
	}
	
	public void initial() {
		userName="";
		userId=0;
		password="";
		tAdd=new Date();
		tEdit=new Date();
		deleted=0;
		zoneId = "";
		classPath = "";
		dealerId = "";
		dealerName = "";
		sysLevel = DEALER_LEVEL;
	}
	
	public String getDealerId() {
		return dealerId;
	}

	public void setDealerId(String dealerId) {
		this.dealerId = dealerId;
	}

	public void valid() {
		if (userName==null || userName.isEmpty() ) {
			userName="";
		}
		if (dealerName==null || dealerName.isEmpty() ) {
			dealerName="";
		}
		if (deleted==null) {
			deleted = 0;
		}
		if (zoneId==null) zoneId = "";
		if (classPath==null) classPath = "";
		if (password==null) password = "";
		if (sysLevel==null) {
			sysLevel = DEALER_LEVEL;
		}

		if (tAdd==null) {
			tAdd=new Date();
		}
		tEdit=new Date();
	}
	
	public Date gettAdd() {
		return tAdd;
	}

	public void settAdd(Date tAdd) {
		this.tAdd = tAdd;
	}

	public Date gettEdit() {
		return tEdit;
	}

	public void settEdit(Date tEdit) {
		this.tEdit = tEdit;
	}

	public String getZoneId() {
		return zoneId;
	}

	public void setZoneId(String zoneId) {
		this.zoneId = zoneId;
	}

	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Integer getUserId() {
		return userId;
	}
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public short getDeleted() {
		return deleted;
	}
	public void setDeleted(short deleted) {
		this.deleted = deleted;
	}

}
